/*
 * GeoVISTA Center (Penn State, Dept. of Geography)
 * Copyright (c), 2003-2011,  Jin Chen and Alan M. MacEachren, GeoVISTA Center, Penn State University
 * Licensed under Simplified BSD License
 *
 *
 * @author: jin Chen 
 * @date: Jan 11, 2005$
 * @version: 1.0
 */
package edu.psu.geovista.app.pcp.toolkits.config.ui;

import javax.swing.*;
import java.awt.*;


public class BasicConfigurePane extends javax.swing.JPanel {

    /** Creates new form BasicConfigurePane */
    public BasicConfigurePane() {
        initComponents();
    }
    /**
     * Set action for the actions displayed on controlP. It will created buttons for you
     * Order of buttons on controlP is same as the order of actions
     * @param actions
     */
    public void setActions(Action[] actions ){
        controlP.removeAll();
         for (int i=0;i<actions.length ;i++){
             JButton btn=new JButton(actions[i]);
              this.controlP.add(btn) ;
         }
         controlP.revalidate();

    }

    public JPanel getMainP() {
        return mainP;
    }

    public void setMainP(JPanel mainP) {
        this.remove(this.mainP);
        this.mainP = mainP;
        this.add(this.mainP,BorderLayout.CENTER);
        mainP.setBorder(new javax.swing.border.BevelBorder(javax.swing.border.BevelBorder.RAISED));
       this.revalidate();
    }

    public JPanel getControlP() {
        return controlP;
    }

    public void setControlP(JPanel controlP) {
        this.remove(this.controlP);
        this.controlP = controlP;
        this.add(this.controlP,BorderLayout.CENTER );
        this.revalidate();

    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    private void initComponents() {
        mainP = new javax.swing.JPanel();
        controlP = new javax.swing.JPanel();
        /*applyBtn = new javax.swing.JButton();
        resetBtn = new javax.swing.JButton();
        cancelBtn = new javax.swing.JButton();
        okBtn = new javax.swing.JButton();*/

        setLayout(new java.awt.BorderLayout());

        mainP.setLayout(new java.awt.BorderLayout());

        mainP.setBorder(new javax.swing.border.BevelBorder(javax.swing.border.BevelBorder.RAISED));
        add(mainP, java.awt.BorderLayout.CENTER);

        controlP.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.RIGHT));

        /*applyBtn.setText("Apply");
        controlP.add(applyBtn);

        resetBtn.setText("Reset Default");
        resetBtn.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        controlP.add(resetBtn);

        cancelBtn.setText("Cancel");
        controlP.add(cancelBtn);

        okBtn.setText("OK");
        okBtn.setActionCommand("OK");
        controlP.add(okBtn);*/

        add(controlP, java.awt.BorderLayout.SOUTH);

    }


    // Variables declaration - do not modify
    private javax.swing.JPanel controlP;
    private javax.swing.JPanel mainP;
    // End of variables declaration

}
